|
Week 2 - Blink Using OS
|
Macros | |
| #define | CPU_50MHZ_CLOCK (SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_SYSDIV_4) |
| #define | CPU_80MHZ_CLOCK (SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_SYSDIV_2_5) |
Functions | |
| void | init_gpio (void) |
Board support declarations and functions for the Tiva C Series TM4C123G and the BOOSTXL-SENSEHUB.
LAUNCH_OUTPUT_DATA and BOOST_OUTPUT_DATA refer to the output GPIO pins on the Launchpad and SenseHub boards respectively.
The Launchpad has one RGB led, the individual pins of this LED are addressed as RED_LED_PIN, GREEN_LED_PIN, and GREEN_LED_PIN. Oring these addresses together produces a blended color.
The SenseHub board has a single yellow LED which is addressed as YELLOW_LED_PIN.
| #define CPU_50MHZ_CLOCK (SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_SYSDIV_4) |
Settings to use SysCtlClockSet() to start the main system clock running at 50MHz.
SYSCTL_XTAL_16MHZ and SYSCTL_OSC_MAIN turn on the 16MHZ external crystal.
SYSCTL_USE_PLL and SYSCTL_SYSDIV_4 instruct the processor to use the PLL divided by 4 as the main clock. The PLL always runs at 400MHZ with a pre-divide by 2. Therefore the CPU clock frequency will be 200MHZ / 4 = 50MHZ.
| #define CPU_80MHZ_CLOCK (SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_SYSDIV_2_5) |
Settings to use SysCtlClockSet() to start the main system clock running at 80MHz.
SYSCTL_XTAL_16MHZ and SYSCTL_OSC_MAIN turn on the 16MHZ external crystal.
SYSCTL_USE_PLL and SYSCTL_SYSDIV_2_5 instruct the processor to use the PLL divided by 2.5 as the main clock. The PLL always runs at 400MHZ with a pre-divide by 2. Therefore the CPU clock frequency will be 200MHZ / 2.5 = 80MHZ. *
1.8.9.1